<template>
  <span>
    <span v-for="item in labels" :key="item">
      <el-tag type="success" size="mini" v-if="item==='原创'">{{item}}</el-tag>
      <el-tag size="mini" v-else>{{item}}</el-tag>
    </span>
  </span>
</template>

<script>
export default {
  props: {
    label: { type: String, default: '' }
  },
  data () {
    return {
      labels: []
    }
  },
  methods: {
    setLabel (lab) {
      if (lab === '') {
        this.labels = []
      } else {
        this.labels = lab.split(',')
      }
    }
  },
  mounted () {
    this.setLabel(this.label)
  }
}
</script>
